home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- //
- // Creation Date: Nov 4, 1999
- //
- // Procedure:
- // subdIntoPolyMode
- //
- // Description:
- // Given a subdivision surface (with no construction history),
- // create a polygon. For more details see the description
- // with "subdiIntoPolyMode" function below.
- //
-
- global proc subdIntoPolyMode( int $hookAsHistory, int $allowHistory,
- int $templateSubd )
- //
- // Description:
- // If $allowHistory is set, we will try and find a polygon in the
- // history of this object, delete that polygon's blind data of
- // the "hierarchical edits" type and put the new blind data on
- // the polygon shape. If $allowHistory is not set, we will fail
- // if the subd has history in the first place. If there is no
- // history on the subd, $allowHistory is ignored. In that case,
- // we will make a new polygon (using "point position" option and
- // the base mesh on the subd -> poly conversion) and give it the blind
- // data that represents the hierarchical edits. If $hookAsHistory is
- // set, we will then plug everything through polyToSubdiv node into
- // the subd we started with. Otherwise, we just leave it be. Note
- // that subd -> poly must be done without history, or we can end up
- // with a loop.
- {
- global int $gSelectSubdivSurface;
-
- string $list[] = `filterExpand -ex 1 -fp 1 -sm $gSelectSubdivSurface`;
- int $len = size($list);
-
- if( 0 == $len ) {
- error( "Select a subdivision surface to switch to the polygon mode" );
- return;
- }
-
- // Do each one in turn...
- int $i;
- for( $i=0; $i<$len; $i+=1 ) {
- subdGivenIntoPolyMode( $list[$i], $hookAsHistory,
- $allowHistory, $templateSubd, 0 );
- }
- }
-